\section{GNSS precise point positioning (PPP)}\label{cookbook.gnssPpp}
This cookbook chapter describes an example of GNSS precise point positioning (PPP) for a ground station using GPS, GLONASS, and Galileo.
For information on how to generate the GNSS products (orbits, clocks, signal biases, etc.) required for PPP,
see the cookbook \reference{GNSS satellite orbit determination and station network analysis}{cookbook.gnssNetwork}.

An example scenario for this task is available at \url{https://ftp.tugraz.at/outgoing/ITSG/groops/scenario/scenarioGnssPPP.zip}.
It includes GROOPS scripts and data for the example, but not the general GROOPS data and metadata found at \url{https://ftp.tugraz.at/outgoing/ITSG/groops} (data folder or zipped archive).
The scenario generally represents what is described in this cookbook, but may slightly differ in certain settings.

\subsection{Data preparation}\label{cookbook.gnssPpp:metadata}
Most of the required metadata files are provided in GROOPS file formats at \url{https://ftp.tugraz.at/outgoing/ITSG/groops}.
These files are regularly updated.

Data that has to be gathered from other sources comprises:
\begin{itemize}
  \item \textbf{Receiver observations}: GNSS measurements converted from RINEX format (see \program{RinexObservation2GnssReceiver})
  \item \textbf{Precise orbits}: precise orbits in CRF for orbit integration (see \program{Sp3Format2Orbit})
  \item \textbf{Precise clocks}: precise clocks (see \program{GnssClockRinex2InstrumentClock})
  \item \textbf{Attitude}: rotation from body frame to CRF (see \program{SimulateStarCameraGnss} or \program{GnssOrbex2StarCamera})
  \item \textbf{Signal biases}: code (and phase) biases (see \program{GnssSinexBias2SignalBias})
\end{itemize}
Receiver observations, precise satellite orbits and clocks, and possibly attitude and signal biases can be downloaded from the
\href{https://igs.org/data-products-overview/}{IGS Data Centers}.
GPS, GLONASS, and Galileo orbits, clocks, attitude, and signal biases for the period 1994-2020 are also available as part of
\href{https://doi.org/10.3217/dataset-4528-0723-0867}{Graz University of Technology's contribution to IGS repro3}.

The \href{https://ftp.tugraz.at/outgoing/ITSG/groops/scenario/scenarioGnssPPP.zip}{example scenario} includes a small set of this data.
The script \verb|010groopsConvert.xml| can be used to convert these external formats into GROOPS formats.

Prepare a \file{station list file}{stringList} that contains the stations (one per line) to be processed.

\subsection{Processing of a ground station}\label{cookbook.gnssPpp:processing}
The script \verb|02groopsGnssProcessing.xml| in the \href{https://ftp.tugraz.at/outgoing/ITSG/groops/scenario/scenarioGnssPPP.zip}{example scenario}
implements the following steps and settings.

These are the settings for \program{GnssProcessing}. If not otherwise stated use the default values.

The first step is setting the processing sampling, in this example it is 30~seconds.
The processing interval usually is a single 24-hour day,
\configClass{timeSeries:uniformSampling}{timeSeriesType:uniformSampling} with \config{timeStart}=\verb|<mjd>|,
\config{timeEnd}=\verb|<mjd>+1|, \config{sampling}=\verb|30/86400| (processing sampling).

Add the appropriate \configClass{transmitters:gnss}{gnssTransmitterGeneratorType:gnss} (e.g. GPS, GLONASS, and Galileo)
and provide the required files (from \reference{Data preparation}{cookbook.gnssPpp:metadata}):
\begin{itemize}
  \item \configFile{inputfileOrbit}{instrument}
  \item \configFile{inputfileAttitude}{instrument}
  \item \configFile{inputfileClock}{instrument}
\end{itemize}

The following settings are needed in \configClass{receiver:stationNetwork}{gnssReceiverGeneratorType:stationNetwork}:
\begin{itemize}
   \item \configFile{inputfileStationList}{stringList}: list of all stations to be processed
   \item \configFile{inputfileObservations}{instrument}: The converted RINEX observation file.
   \item \configClass{tidalDisplacement}{tidesType}: Use the settings described in \reference{receiver:stationNetwork}{gnssReceiverGeneratorType:stationNetwork}.
   \item \configClass{useType}{gnssType}: We recommend to explicitly specify the signals to be processed
            and to make sure that at least transmitter code biases are provided for each of them, e.g. \verb|C1CG|,
            \verb|C1WG|, \verb|C2WG|, \verb|L1*G|, \verb|L2*G|, ...).
   \item \configClass{excludeType}{gnssType}: Signals you might want to exclude are \verb|L5*G| (GPS L5 phase due to time-variable bias on block IIF satellites), \verb|*3*R| (GLONASS G3 freq.), \verb|*6*E| (Galileo E6 freq.)
\end{itemize}

Add the following \configClass{parametrizations}{gnssParametrizationType}
and define the \config{outputfiles} you are interested in inside each of them:
\begin{itemize}
  \item \configClass{ionosphereSTEC}{gnssParametrizationType:ionosphereSTEC}: add a constraint of \config{sigmaSTEC}=\verb|40|
  \item \configClass{ionosphereVTEC}{gnssParametrizationType:ionosphereVTEC}
  \item \configClass{clocks}{gnssParametrizationType:clocks}: delete \configClass{selectTransmitters}{gnssTransceiverSelectorType}
  \item \configClass{signalBiases}{gnssParametrizationType:signalBiases}: provide \configFile{inputfileSignalBiasTransmitter}{gnssSignalBias} from
        \reference{Data preparation}{cookbook.gnssPpp:metadata}.
  \item \configClass{ambiguities}{gnssParametrizationType:ambiguities}: if precise transmitter phase biases are available you can delete \configClass{estimateTransmitterPhaseBiases}{gnssTransceiverSelectorType}
  \item \configClass{codeBiases}{gnssParametrizationType:codeBiases}: delete \configClass{selectTransmitters}{gnssTransceiverSelectorType}, set \config{sigmaZeroMeanConstraint}=\verb|0|
  \item \configClass{tecBiases}{gnssParametrizationType:tecBiases}: delete \configClass{selectTransmitters}{gnssTransceiverSelectorType}, set \config{sigmaZeroMeanConstraint}=\verb|0|
  \item \configClass{kinematicPositions}{gnssParametrizationType:kinematicPositions}
  \item \configClass{troposphere}{gnssParametrizationType:troposphere}: select \configClass{troposphere:viennaMapping}{troposphereType:viennaMapping}
        with the appropriate vmf3grid file. Add \configClass{troposphereWetEstimation:splines}{parametrizationTemporalType:splines}
        with linear (\config{degree}=\verb|1|) 2-hourly splines
        and \configClass{troposphereGradientEstimation:splines}{parametrizationTemporalType:splines} with linear daily splines.
  \item \configClass{constraints}{gnssParametrizationType:constraints}: loose constraint troposphere estimates,
        \configClass{parameters:wildcard:type}{parameterSelectorType:wildcard}=\verb|troposphere*|, \config{sigma}=\verb|5|, and \config{relativeToApriori}=\verb|yes|
\end{itemize}

Add the following \configClass{processingSteps}{gnssProcessingStepType}:
\begin{itemize}
  \item \configClass{estimate}{gnssProcessingStepType:estimate}: with \config{maxIterationCount}=\verb|8|
  \item \configClass{resolveAmbiguities}{gnssProcessingStepType:resolveAmbiguities}
  \item \configClass{estimate}{gnssProcessingStepType:estimate}: with \config{maxIterationCount}=\verb|2|
  \item \configClass{writeResults}{gnssProcessingStepType:writeResults}
\end{itemize}

When processing multiple stations at the same time, moving \configClass{estimate}{gnssProcessingStepType:estimate}
and \configClass{resolveAmbiguities}{gnssProcessingStepType:resolveAmbiguities} into the processing step
\configClass{forEachReceiverSeparately}{gnssProcessingStepType:forEachReceiverSeparately} sets up and solves
the normal equations independently for each station.

% =============================================================
